Skip to content

Conversation

DeinAlptraum
Copy link
Contributor

Missing CursorKinds that were added in #143264 follow the name format of Index.h instead of those in cindex.py
Adapt the names accordingly.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:as-a-library libclang and C++ API labels Sep 23, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2025

@llvm/pr-subscribers-clang

Author: Jannick Kremer (DeinAlptraum)

Changes

Missing CursorKinds that were added in #143264 follow the name format of Index.h instead of those in cindex.py
Adapt the names accordingly.


Full diff: https://github.com/llvm/llvm-project/pull/160295.diff

1 Files Affected:

  • (modified) clang/bindings/python/clang/cindex.py (+16-16)
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 13a91d83ede1c..c44e646a30f17 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -1435,13 +1435,13 @@ def is_unexposed(self):
     OMP_SCOPE_DIRECTIVE = 306
 
     # OpenMP reverse directive.
-    OMPReverseDirective = 307
+    OMP_REVERSE_DIRECTIVE = 307
 
     # OpenMP interchange directive.
-    OMPInterchangeDirective = 308
+    OMP_INTERCHANGE_DIRECTIVE = 308
 
     # OpenMP assume directive.
-    OMPAssumeDirective = 309
+    OMP_ASSUME_DIRECTIVE = 309
 
     # OpenMP stripe directive.
     OMP_STRIPE_DIRECTIVE = 310
@@ -1450,43 +1450,43 @@ def is_unexposed(self):
     OPEN_ACC_COMPUTE_DIRECTIVE = 320
 
     # OpenACC Loop Construct.
-    OpenACCLoopConstruct = 321
+    OPEN_ACC_LOOP_CONSTRUCT = 321
 
     # OpenACC Combined Constructs.
-    OpenACCCombinedConstruct = 322
+    OPEN_ACC_COMBINED_CONSTRUCT = 322
 
     # OpenACC data Construct.
-    OpenACCDataConstruct = 323
+    OPEN_ACC_DATA_CONSTRUCT = 323
 
     # OpenACC enter data Construct.
-    OpenACCEnterDataConstruct = 324
+    OPEN_ACC_ENTER_DATA_CONSTRUCT = 324
 
     # OpenACC exit data Construct.
-    OpenACCExitDataConstruct = 325
+    OPEN_ACC_EXIT_DATA_CONSTRUCT = 325
 
     # OpenACC host_data Construct.
-    OpenACCHostDataConstruct = 326
+    OPEN_ACC_HOST_DATA_CONSTRUCT = 326
 
     # OpenACC wait Construct.
-    OpenACCWaitConstruct = 327
+    OPEN_ACC_WAIT_CONSTRUCT = 327
 
     # OpenACC init Construct.
-    OpenACCInitConstruct = 328
+    OPEN_ACC_INIT_CONSTRUCT = 328
 
     # OpenACC shutdown Construct.
-    OpenACCShutdownConstruct = 329
+    OPEN_ACC_SHUTDOWN_CONSTRUCT = 329
 
     # OpenACC set Construct.
-    OpenACCSetConstruct = 330
+    OPEN_ACC_SET_CONSTRUCT = 330
 
     # OpenACC update Construct.
-    OpenACCUpdateConstruct = 331
+    OPEN_ACC_UPDATE_CONSTRUCT = 331
 
     # OpenACC atomic Construct.
-    OpenACCAtomicConstruct = 332
+    OPEN_ACC_ATOMIC_CONSTRUCT = 332
 
     # OpenACC cache Construct.
-    OpenACCCacheConstruct = 333
+    OPEN_ACC_CACHE_CONSTRUCT = 333
 
     ###
     # Other Kinds

@Endilll
Copy link
Contributor

Endilll commented Sep 24, 2025

This is not acceptable as is, because it breaks backwards compatibility.
We should leverage https://docs.python.org/3/library/enum.html#enum.Enum._missing_ to keep old names working, issuing a deprecation warning. Also, a release note is due.

@DeinAlptraum
Copy link
Contributor Author

The enums I'm adapting here are the ones I've added in #143264, merged less than a week ago.
Since this is not released yet, I thought this isn't an issue?

@Endilll
Copy link
Contributor

Endilll commented Sep 24, 2025

Oh, I see. #143264 is missing a release note for those newly added enumerators, so this should be good to go after you add one.

@DeinAlptraum
Copy link
Contributor Author

Added a release note

@DeinAlptraum DeinAlptraum merged commit 508748d into llvm:main Sep 25, 2025
12 checks passed
@DeinAlptraum DeinAlptraum deleted the fix-enum-names branch September 25, 2025 12:36
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
…m#160295)

Missing `CursorKind`s that were added in llvm#143264 follow the name format
of Index.h instead of those in cindex.py. Adapt the names accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:as-a-library libclang and C++ API clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants